package com.qf.springboot.scheduled;

import com.qf.springboot.service.UserService;
import com.qf.springboot.vo.ResultVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ClearImgSchedule {
    @Autowired
    private UserService userService;

    @Scheduled(fixedDelay = 30000)
    public void clearPic() {
        ResultVo resultVo = userService.selectAndClearAllPhotopath();
        log.debug("本地头像清理结果：{}", resultVo.getMessage());
    }
}
